package org.example.demo3.demos.web.vmsnvattrandtadvaltax.Service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.demo3.demos.web.common.ResponseEnum;
import org.example.demo3.demos.web.entity.NvatRevenuemapself;
import org.example.demo3.demos.web.exception.BusinessException;
import org.example.demo3.demos.web.vmsnvattrandtadvaltax.Service.VmsNvatRevenuemapselfService;
import org.example.demo3.demos.web.vmsnvattrandtadvaltax.mapper.VmsNvatRevenuemapselfMapper;
import org.springframework.stereotype.Service;

@Service
public class VmsNvatRevenuemapselfServiceImpl extends ServiceImpl<VmsNvatRevenuemapselfMapper, NvatRevenuemapself> implements VmsNvatRevenuemapselfService {
    @Override
    public NvatRevenuemapself getRevenuemapselftByXrdid(String id) {

        NvatRevenuemapself one = getOne(new LambdaQueryWrapper<NvatRevenuemapself>()
                .eq(NvatRevenuemapself::getXrdid,id),false); // 第二个参数,是否抛出异常. false就是不抛出.
        if(one == null){
            throw new BusinessException(ResponseEnum.TRANSACTION_FLOW_INFORMATION_DOES_NOT_EXIST);
        }
        return one;
    }
}
